<!DOCTYPE HTML>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:th="http://www.thymeleaf.org" lang="zh">
<head th:replace="common/header::header"/>
<body>
<article class="page-container">
    <form class="form form-horizontal" id="form-role-add">
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>角色名称:</label>
            <div class="formControls col-xs-8 col-sm-8">
                <input type="text" class="input-text" placeholder="" id="roleName" name="roleName" th:attr="value=(${role}?(${role.roleName}):'')" style="width: 410px"/>
            </div>
        </div>
        <span th:if="${role}">
            <input type="hidden" name="roleId" id="roleId" th:value="${role.roleId}"/>
        </span>
        <div th:if="${role}">
            <div class="row cl">
                <label class="form-label col-xs-4 col-sm-3">是否有效：</label>
                <div class="formControls col-xs-8 col-sm-8">
                <span class="select-box" style="width:410px;">
                    <select class="select" name="status" size="1" th:switch="${role.status}">
                        <option th:text="${role.status}==1?'有效':'无效'" th:attr="value=${role.status}"></option>
                        <option th:text="${role.status}==0?'有效':'无效'" th:attr="value=(${role.status}==1?'0':'1')"></option>

                    </select>
			    </span>
                </div>
            </div>
        </div>
        <div th:unless="${role}">
            <div class="row cl">
                <label class="form-label col-xs-4 col-sm-3">是否无效：</label>
                <div class="formControls col-xs-8 col-sm-8">
                    <span class="select-box" style="width:410px;">
                        <select class="select" name="status" size="1">
                            <option value="0">无效</option>
                            <option value="1">有效</option>
                        </select>
                    </span>
                </div>
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-3">备注：</label>
            <div class="formControls col-xs-8 col-sm-8">
                <textarea name="remark" id="remark" class="textarea"  placeholder="" th:text="${role}?(${role.remark}):''" style="width: 410px"></textarea>
            </div>
        </div>
        <div class="row cl">
            <div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-3">
                <input class="btn btn-primary radius" type="submit" id="sub" value="&nbsp;&nbsp;提交&nbsp;&nbsp;"/>
                <button onclick="layer_close()" class="btn btn-default radius" type="button">&nbsp;&nbsp;取消&nbsp;&nbsp;</button>
            </div>
        </div>
    </form>
</article>
<script th:src="@{/js/permission/role/roleAdd.js}" th:inline="javascript"/>
</body>
</html>